package com.sdlg.controller;

import com.sdlg.pojo.Announcement;
import com.sdlg.pojo.BookItem;
import com.sdlg.service.AnnouncementService;
import com.sdlg.service.BookItemService;
import com.sdlg.util.PageResult;
import com.sdlg.util.QueryPageBean;
import com.sdlg.util.Result;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;
import java.io.File;
import java.util.UUID;

@RestController
@RequestMapping("/announce")
public class AnnouncementController {

    @Resource
    private AnnouncementService announcementService;

    //分页展示检查指标数据
    @RequestMapping("/findPage")
    public PageResult findPage(@RequestBody QueryPageBean queryPageBean){
        PageResult pageResult=announcementService.findPage(queryPageBean);
        return pageResult;
    }

    //添加指标数据
    @RequestMapping("/saveItem")
    public Result saveItem(@RequestBody Announcement announcement){
        Result result=announcementService.saveItem(announcement);
        return result;
    }

    //根据id删除数据
    @RequestMapping("/deleteById")
    public Result deleteById(Integer id){
        Result result=announcementService.deleteById(id);
        return result;
    }


}
